﻿using System;
using System.Globalization;

namespace Lapd.Common.Helpers
{
    public static class GoogleMapsHelper
    {
        private const string GOOGLE_MAPS_URL_TEMPLATE = "http://maps.google.com/m/local?q={0},{1}";

        public static string GetUrlByLatitudeAndLongitude(double latitude, double longitude)
        {
            // The use of CultureInfo.InvariantCulture is to avoid different decimal
            // symbols on different cultures (e.g. "." on en-US and "," on es-ES)
            return String.Format(
                GOOGLE_MAPS_URL_TEMPLATE,
                latitude.ToString(CultureInfo.InvariantCulture),
                longitude.ToString(CultureInfo.InvariantCulture));
        }
    }
}
